# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'browser.ui'
#
# Created: Mon Sep  8 02:19:41 2008
#      by: PyQt4 UI code generator 4.4.3
#
# WARNING! All changes made in this file will be lost!

from PyQt4 import QtCore, QtGui
from PyQt4 import QtWebKit
import sys
import codecs

sys.stdin = codecs.getreader("UTF8")(sys.stdin)
sys.stdout = codecs.getwriter("UTF8")(sys.stdout)

class Ui_Form(object):
    def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(760, 523)
        self.webView = QtWebKit.QWebView(Form)
        self.webView.setGeometry(QtCore.QRect(10, 70, 1111, 691))
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.webView.sizePolicy().hasHeightForWidth())
        self.webView.setSizePolicy(sizePolicy)
        self.webView.setContextMenuPolicy(QtCore.Qt.DefaultContextMenu)
        self.webView.setAutoFillBackground(True)
        self.webView.setUrl(QtCore.QUrl("http://code.google.com/p/piti8rowser/"))
        self.webView.setObjectName("webView")
        self.pushButton = QtGui.QPushButton(Form)
        self.pushButton.setGeometry(QtCore.QRect(40, 20, 75, 28))
        self.pushButton.setObjectName("pushButton")
        self.pushButton_2 = QtGui.QPushButton(Form)
        self.pushButton_2.setGeometry(QtCore.QRect(130, 20, 75, 28))
        self.pushButton_2.setObjectName("pushButton_2")
        self.commandLinkButton = QtGui.QCommandLinkButton(Form)
        self.commandLinkButton.setGeometry(QtCore.QRect(1020, 10, 91, 41))
        font = QtGui.QFont()
        font.setPointSize(14)
        font.setWeight(50)
        font.setItalic(True)
        font.setBold(False)
        self.commandLinkButton.setFont(font)
        self.commandLinkButton.setAutoFillBackground(True)
        self.commandLinkButton.setIconSize(QtCore.QSize(40, 40))
        self.commandLinkButton.setObjectName("commandLinkButton")
        self.lineEdit = QtGui.QLineEdit(Form)
        self.lineEdit.setGeometry(QtCore.QRect(220, 20, 781, 24))
        self.lineEdit.setObjectName("lineEdit")

        self.retranslateUi(Form)
        QtCore.QObject.connect(self.pushButton, QtCore.SIGNAL("clicked()"), self.homepage)
        QtCore.QObject.connect(self.pushButton_2, QtCore.SIGNAL("clicked()"), self.mk18)
        QtCore.QObject.connect(self.commandLinkButton, QtCore.SIGNAL("clicked()"), self.go)
        QtCore.QObject.connect(self.lineEdit, QtCore.SIGNAL("returnPressed()"), self.go)
        QtCore.QMetaObject.connectSlotsByName(Form)
    
    def event(self, event):
        if (event.type()==QEvent.KeyPress) and (event.key()==Qt.Key_Return):
            self.emit(SIGNAL("returnPressed"))
            return True
            
        return QLineEdit.event(self, event)

	
    def homepage(self):
	        hmp = self.webView.setUrl(QtCore.QUrl("http://www.cuil.com"))
                window.setWindowTitle("Piti8rowser - Homepage")

    def mk18(self):
	        mk = self.webView.setUrl(QtCore.QUrl("http://mk18.wordpress.com/"))
	        window.setWindowTitle("Piti8rowser - MK18")
		
    def go(self):
              	adres = str("http://"+self.lineEdit.text())
	    	self.webView.setUrl(QtCore.QUrl(adres))
		window.setWindowTitle("Piti8rowser - "+adres)
			
    def retranslateUi(self, Form):
	Form.setWindowTitle(QtGui.QApplication.translate("Form", "Piti8rowser - Before browse,you must not type http:// in address bar", None, QtGui.QApplication.UnicodeUTF8))
        self.pushButton.setText(QtGui.QApplication.translate("Form", "Home Page", None, QtGui.QApplication.UnicodeUTF8))
        self.pushButton_2.setText(QtGui.QApplication.translate("Form", "MK18", None, QtGui.QApplication.UnicodeUTF8))
	self.commandLinkButton.setText(QtGui.QApplication.translate("Form","Go",None,QtGui.QApplication.UnicodeUTF8))
	
App=QtGui.QApplication(sys.argv)
window=QtGui.QMainWindow()
ui = Ui_Form()
ui.setupUi(window)
window.show()

sys.exit(App.exec_())	


